<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emacps: xemacps_ieee1588_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emacps
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xemacps__ieee1588__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xemacps_ieee1588_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This is top level c file for the IEEE1588 (PTP) standalone example. </p>
<p>It has the following functionalities. It uses SCUTimer to transmit PTP packets at regular intervals.</p><ul>
<li>Contains the main routine for the PTP protocol example.</li>
<li>Initializes the SCUGIC, SCUTimer</li>
<li>Initializes the EmacPs hardware for packet transfer.</li>
<li>Initializes the buffer descriptors for the PTP packet transfer.</li>
<li>Initializes and handles the buffers that receive the PTP packets and whose address goes in the buffer descriptors.</li>
<li>Contains the interrupt handlers for Ethernet Tx and Ethernet Rx.</li>
<li>Contains the Timer interrupt handlers.</li>
<li>Implements the top level state machine for the PTP protocol.</li>
<li>Contains routines that initiate the PTP Tx.</li>
<li>Initializes the some fields in the PTP Tx packets. These fields are fixed and its entries do not change with time.</li>
<li>Contains various helper routines, e.g. routines for endian conversion.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

1.00a asa  09/16/11 First release based on the AVB driver.
1.01a asa  03/03/12 Support for Zynq is added. BD handling is changed.
3.3   asa  05/19/16 Fix for CR#951152. Made following changes.<ul>
<li>Removed code specific for PEEP.</li>
<li>Ensured that each buffer in RxBuf array is cache
                      line aligned. The Rxbuf array itself is made cache
                      line aligned.</li>
<li>The XEMACPS_PACKET_LEN is changed from 1538 to 1598.
                      Though the packet length can never be 1598 for
                      non-jumbo ethernet packets, it is changes to ensure
                      that each Rx buffer becomes cache line aligned.
                      If a Rx buffer is not cache line aligned, the
                      A9 based invalidation logic flushes the first cache
                      line to ensure that other data faling in this cache
                      line are not lost when the buffer in invalidated
                      upon reception of a packet. But that will also mean
                      the data received in this cache line is lost.
                      By making this change we always ensure that when an
                      invalidation happens no flushing takes place and no
                      incoming data is lost.</li>
<li>Changes made not to disable and enable back the MMU
                      when we change the attribute of BD space to make it
                      strongly ordered.

</li>
</ul>
</pre></div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a60ba6528f84c63eddc3c140b300efca5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a60ba6528f84c63eddc3c140b300efca5">XEmacPs_InitScuTimer</a> (void)</td></tr>
<tr class="memdesc:a60ba6528f84c63eddc3c140b300efca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the SCUTimer.  <a href="#a60ba6528f84c63eddc3c140b300efca5">More...</a><br /></td></tr>
<tr class="separator:a60ba6528f84c63eddc3c140b300efca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add0c0b1f239d066840410743cdea56a7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#add0c0b1f239d066840410743cdea56a7">XEmacPs_PHYSetup</a> (<a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *EmacPsInstancePtr)</td></tr>
<tr class="memdesc:add0c0b1f239d066840410743cdea56a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function configures the PHY with proper speed settings and set up the PHY to be used subsequently.  <a href="#add0c0b1f239d066840410743cdea56a7">More...</a><br /></td></tr>
<tr class="separator:add0c0b1f239d066840410743cdea56a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29261bb6048535d05b0e3e4cc417f3b8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a29261bb6048535d05b0e3e4cc417f3b8">XEmacPs_SetupIntrSystem</a> (XScuGic *IntcInstancePtr, <a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *EmacPsInstancePtr, XScuTimer *TimerInstancePtr, u16 EmacPsIntrId, u16 TimerIntrId)</td></tr>
<tr class="memdesc:a29261bb6048535d05b0e3e4cc417f3b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets up interrupts.  <a href="#a29261bb6048535d05b0e3e4cc417f3b8">More...</a><br /></td></tr>
<tr class="separator:a29261bb6048535d05b0e3e4cc417f3b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27633bcf101d94ffbe334032282ac743"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a27633bcf101d94ffbe334032282ac743">XEmacPs_RunIEEE1588Protocol</a> (<a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *EmacInstance)</td></tr>
<tr class="memdesc:a27633bcf101d94ffbe334032282ac743"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function implements the main state machine.  <a href="#a27633bcf101d94ffbe334032282ac743">More...</a><br /></td></tr>
<tr class="separator:a27633bcf101d94ffbe334032282ac743"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8da30744d86bbb68534b012879e71b4f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a8da30744d86bbb68534b012879e71b4f">XEmacPs_InitializeEmacPsDma</a> (XEmacPs_Ieee1588 *InstancePntr)</td></tr>
<tr class="memdesc:a8da30744d86bbb68534b012879e71b4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the EmacPs DMA buffer descriptors.  <a href="#a8da30744d86bbb68534b012879e71b4f">More...</a><br /></td></tr>
<tr class="separator:a8da30744d86bbb68534b012879e71b4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aae1b911dbc718a33b33b97fa7ac4e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData</a> (XEmacPs_Ieee1588 *InstancePntr)</td></tr>
<tr class="memdesc:a9aae1b911dbc718a33b33b97fa7ac4e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does various initializations.  <a href="#a9aae1b911dbc718a33b33b97fa7ac4e8">More...</a><br /></td></tr>
<tr class="separator:a9aae1b911dbc718a33b33b97fa7ac4e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ffeb1c5ab24c4077e7c2591eaf7c03b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a0ffeb1c5ab24c4077e7c2591eaf7c03b">XEmacPs_HandleRecdPTPPacket</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a0ffeb1c5ab24c4077e7c2591eaf7c03b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is processes the received packets.  <a href="#a0ffeb1c5ab24c4077e7c2591eaf7c03b">More...</a><br /></td></tr>
<tr class="separator:a0ffeb1c5ab24c4077e7c2591eaf7c03b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af93807a4c6a17813088a71fdd6bf83f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#af93807a4c6a17813088a71fdd6bf83f4">XEmacPs_PtpTxInterruptHandler</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:af93807a4c6a17813088a71fdd6bf83f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the Tx Done interrupt callback invoked from the EmacPs driver.  <a href="#af93807a4c6a17813088a71fdd6bf83f4">More...</a><br /></td></tr>
<tr class="separator:af93807a4c6a17813088a71fdd6bf83f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2606ea47dd80be535954c8aafc162aa7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a2606ea47dd80be535954c8aafc162aa7">XEmacPs_SetDfltTxFrms</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a2606ea47dd80be535954c8aafc162aa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to populate the PTP Tx buffers.  <a href="#a2606ea47dd80be535954c8aafc162aa7">More...</a><br /></td></tr>
<tr class="separator:a2606ea47dd80be535954c8aafc162aa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63a23dce0edb87eb919ae03f814d9615"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a63a23dce0edb87eb919ae03f814d9615">XEmacPs_GetMsgType</a> (u8 *PacketBuf)</td></tr>
<tr class="memdesc:a63a23dce0edb87eb919ae03f814d9615"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function extracts PTP messgae type information from the PTP packet.  <a href="#a63a23dce0edb87eb919ae03f814d9615">More...</a><br /></td></tr>
<tr class="separator:a63a23dce0edb87eb919ae03f814d9615"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24b724fc0f49b35cb48284662f47ff38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a24b724fc0f49b35cb48284662f47ff38">XEmacPs_PtpTxDoFurtherProcessing</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a24b724fc0f49b35cb48284662f47ff38"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is invoked from the TxDone callback.  <a href="#a24b724fc0f49b35cb48284662f47ff38">More...</a><br /></td></tr>
<tr class="separator:a24b724fc0f49b35cb48284662f47ff38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54ad1a8c2df4fd3f5388a93d7fbb770d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a54ad1a8c2df4fd3f5388a93d7fbb770d">XEmacPs_TimerInterruptHandler</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a54ad1a8c2df4fd3f5388a93d7fbb770d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the timer ISR that is invoked every 500 mseconds.  <a href="#a54ad1a8c2df4fd3f5388a93d7fbb770d">More...</a><br /></td></tr>
<tr class="separator:a54ad1a8c2df4fd3f5388a93d7fbb770d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b7f7095bf60db3e9b040efd685d64c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a3b7f7095bf60db3e9b040efd685d64c3">XEmacPs_PtpErrorInterruptHandler</a> (XEmacPs_Ieee1588 *InstancePtr, u8 Direction, u32 ErrorWord)</td></tr>
<tr class="memdesc:a3b7f7095bf60db3e9b040efd685d64c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the Error interrupt callback invoked from the EmacPs driver.  <a href="#a3b7f7095bf60db3e9b040efd685d64c3">More...</a><br /></td></tr>
<tr class="separator:a3b7f7095bf60db3e9b040efd685d64c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function for the IEEE1588 (PTP) standalone example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfd0ae3fd37438b0c459347d8001ee50"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#adfd0ae3fd37438b0c459347d8001ee50">XEmacPs_TsuCalcClk</a> (u32 Freq)</td></tr>
<tr class="memdesc:adfd0ae3fd37438b0c459347d8001ee50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate clock configuration register values for indicated input clock.  <a href="#adfd0ae3fd37438b0c459347d8001ee50">More...</a><br /></td></tr>
<tr class="separator:adfd0ae3fd37438b0c459347d8001ee50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3b2d1c105d9b1a6452b8da801671b12"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#af3b2d1c105d9b1a6452b8da801671b12">XEmacPs_DetectPHY</a> (<a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *EmacPsInstancePtr)</td></tr>
<tr class="memdesc:af3b2d1c105d9b1a6452b8da801671b12"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function finds out if a PHY is connected or not and if connected what is the PHY address of the connected PHY.  <a href="#af3b2d1c105d9b1a6452b8da801671b12">More...</a><br /></td></tr>
<tr class="separator:af3b2d1c105d9b1a6452b8da801671b12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38b8729ccc6e982cf4fcd3731626b375"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a38b8729ccc6e982cf4fcd3731626b375">XEmacPs_ResetIeee1588Protocol</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a38b8729ccc6e982cf4fcd3731626b375"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used when PTP node is initialized once again.  <a href="#a38b8729ccc6e982cf4fcd3731626b375">More...</a><br /></td></tr>
<tr class="separator:a38b8729ccc6e982cf4fcd3731626b375"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d750260e03c30360de133c3412b146b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a1d750260e03c30360de133c3412b146b">XEmacPs_PtpRxInterruptHandler</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a1d750260e03c30360de133c3412b146b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the EmacPs Rx interrupt callback invoked from the EmacPs driver.  <a href="#a1d750260e03c30360de133c3412b146b">More...</a><br /></td></tr>
<tr class="separator:a1d750260e03c30360de133c3412b146b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c91eead95c645071cc2df1e36109de7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a4c91eead95c645071cc2df1e36109de7">XEmacPs_PtpTxPacket</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf, int PacketLen)</td></tr>
<tr class="memdesc:a4c91eead95c645071cc2df1e36109de7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is initiates a PTP Tx.  <a href="#a4c91eead95c645071cc2df1e36109de7">More...</a><br /></td></tr>
<tr class="separator:a4c91eead95c645071cc2df1e36109de7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0aee2ebfdfe52395961f9c4a5b15063e"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a0aee2ebfdfe52395961f9c4a5b15063e">XEmacPs_IsRxFramePTP</a> (u8 *PacketBuf)</td></tr>
<tr class="memdesc:a0aee2ebfdfe52395961f9c4a5b15063e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function extracts length/type information from the Ethernet packet.  <a href="#a0aee2ebfdfe52395961f9c4a5b15063e">More...</a><br /></td></tr>
<tr class="separator:a0aee2ebfdfe52395961f9c4a5b15063e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7f2340f7993c4f0702f32f5e9e413ba"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity</a> (XEmacPs_PortIdentity Identity1, XEmacPs_PortIdentity Identity2)</td></tr>
<tr class="memdesc:ab7f2340f7993c4f0702f32f5e9e413ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to compare two PortIdentity values.  <a href="#ab7f2340f7993c4f0702f32f5e9e413ba">More...</a><br /></td></tr>
<tr class="separator:ab7f2340f7993c4f0702f32f5e9e413ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3047658e5d93cf96bc6eb8216d81a6fd"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a3047658e5d93cf96bc6eb8216d81a6fd">XEmacPs_CompareClockIdentity</a> (XEmacPs_ClockIdentity Identity1, XEmacPs_ClockIdentity Identity2)</td></tr>
<tr class="memdesc:a3047658e5d93cf96bc6eb8216d81a6fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to compare two ClockIdentity values.  <a href="#a3047658e5d93cf96bc6eb8216d81a6fd">More...</a><br /></td></tr>
<tr class="separator:a3047658e5d93cf96bc6eb8216d81a6fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad20603083c71d3be8253e3bfb869c5b8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity</a> (u8 *PacketBuf, XEmacPs_PortIdentity *portID)</td></tr>
<tr class="memdesc:ad20603083c71d3be8253e3bfb869c5b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to extract portIdentity information from a received PTP frame.  <a href="#ad20603083c71d3be8253e3bfb869c5b8">More...</a><br /></td></tr>
<tr class="separator:ad20603083c71d3be8253e3bfb869c5b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3674aa1b8a9b3b0bd90b5651a7cb98f9"><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a3674aa1b8a9b3b0bd90b5651a7cb98f9">XEmacPs_GetSequenceId</a> (u8 *PacketBuf)</td></tr>
<tr class="memdesc:a3674aa1b8a9b3b0bd90b5651a7cb98f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to extract SequenceId information from a received PTP frame.  <a href="#a3674aa1b8a9b3b0bd90b5651a7cb98f9">More...</a><br /></td></tr>
<tr class="separator:a3674aa1b8a9b3b0bd90b5651a7cb98f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acef839505ebb9e7e3ac182d06a42a25e"><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#acef839505ebb9e7e3ac182d06a42a25e">XEmacPs_IncSequenceId</a> (u8 *PacketBuf)</td></tr>
<tr class="memdesc:acef839505ebb9e7e3ac182d06a42a25e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to increment sequence ID in a PTP frames.  <a href="#acef839505ebb9e7e3ac182d06a42a25e">More...</a><br /></td></tr>
<tr class="separator:acef839505ebb9e7e3ac182d06a42a25e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7430d97c13ae2d1839d71ed8cd433494"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a7430d97c13ae2d1839d71ed8cd433494">XEmacPs_htonll</a> (unsigned long long int n)</td></tr>
<tr class="memdesc:a7430d97c13ae2d1839d71ed8cd433494"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to do endian conversion for long long int type.  <a href="#a7430d97c13ae2d1839d71ed8cd433494">More...</a><br /></td></tr>
<tr class="separator:a7430d97c13ae2d1839d71ed8cd433494"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a186f468b317a1f253570a46b103197f2"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588__example_8c.html#a186f468b317a1f253570a46b103197f2">XEmacPs_ntohll</a> (long long int n)</td></tr>
<tr class="memdesc:a186f468b317a1f253570a46b103197f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to do endian conversion for long long int type.  <a href="#a186f468b317a1f253570a46b103197f2">More...</a><br /></td></tr>
<tr class="separator:a186f468b317a1f253570a46b103197f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function for the IEEE1588 (PTP) standalone example. </p>
<p>It calls routines to initialize ScuTimer and EmacPs. It enables interrupts at the end of all initializations and calls XEmacPs_RunIEEE1588Protocol that runs the protocol state machine.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS to indicate success.<ul>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a3047658e5d93cf96bc6eb8216d81a6fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3047658e5d93cf96bc6eb8216d81a6fd">&#9670;&nbsp;</a></span>XEmacPs_CompareClockIdentity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_CompareClockIdentity </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_ClockIdentity&#160;</td>
          <td class="paramname"><em>Identity1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_ClockIdentity&#160;</td>
          <td class="paramname"><em>Identity2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to compare two ClockIdentity values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Identity1</td><td>is the first ClockIdentity to be compared </td></tr>
    <tr><td class="paramname">Identity2</td><td>is the second ClockIdentity to be compared</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- 1 if the two values are equal<ul>
<li>0 if not equal</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>.</p>

</div>
</div>
<a id="ab7f2340f7993c4f0702f32f5e9e413ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7f2340f7993c4f0702f32f5e9e413ba">&#9670;&nbsp;</a></span>XEmacPs_ComparePortIdentity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_ComparePortIdentity </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_PortIdentity&#160;</td>
          <td class="paramname"><em>Identity1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_PortIdentity&#160;</td>
          <td class="paramname"><em>Identity2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to compare two PortIdentity values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Identity1</td><td>is the first sourcePortIdentity to be compared </td></tr>
    <tr><td class="paramname">Identity2</td><td>is the second sourcePortIdentity to be compared</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- 1 if the two values are equal<ul>
<li>0 if not equal</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a696297bb61249e62e6901699128548c6">XEmacPs_DecodeRxFollowUp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a82e295146b0eeddea22bae58249aa7df">XEmacPs_DecodeRxPDelayResp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#aebc1db0f6eab6b6f44033a7eb5680577">XEmacPs_DecodeRxPDelayRespFollowUp()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a52690e55087c8f5cb908d111c7431552">XEmacPs_DecodeRxSync()</a>.</p>

</div>
</div>
<a id="af3b2d1c105d9b1a6452b8da801671b12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3b2d1c105d9b1a6452b8da801671b12">&#9670;&nbsp;</a></span>XEmacPs_DetectPHY()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long XEmacPs_DetectPHY </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *&#160;</td>
          <td class="paramname"><em>EmacPsInstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function finds out if a PHY is connected or not and if connected what is the PHY address of the connected PHY. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is a pointer to the instance of the EmacPs.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- Detected PHY address if successful.<ul>
<li>0 if no PHY is connected.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#ga0cd6edb3e572b7a40f9e2891f193c584">XEmacPs_PhyRead()</a>.</p>

</div>
</div>
<a id="a63a23dce0edb87eb919ae03f814d9615"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63a23dce0edb87eb919ae03f814d9615">&#9670;&nbsp;</a></span>XEmacPs_GetMsgType()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XEmacPs_GetMsgType </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function extracts PTP messgae type information from the PTP packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>contains the Ethernet packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588__example_8c.html#a24b724fc0f49b35cb48284662f47ff38">XEmacPs_PtpTxDoFurtherProcessing()</a>.</p>

</div>
</div>
<a id="ad20603083c71d3be8253e3bfb869c5b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad20603083c71d3be8253e3bfb869c5b8">&#9670;&nbsp;</a></span>XEmacPs_GetPortIdentity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_GetPortIdentity </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_PortIdentity *&#160;</td>
          <td class="paramname"><em>portID</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to extract portIdentity information from a received PTP frame. </p>
<p>This can be any portIdentity field (header portIdentity, requestingPortIdentity etc...)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>contains the PTP buffer from which the portIdentity is to be extracted. </td></tr>
    <tr><td class="paramname">portID</td><td>is the address of type XEmacPs_PortIdentity is which the extracted port identity is put.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#a696297bb61249e62e6901699128548c6">XEmacPs_DecodeRxFollowUp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a82e295146b0eeddea22bae58249aa7df">XEmacPs_DecodeRxPDelayResp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#aebc1db0f6eab6b6f44033a7eb5680577">XEmacPs_DecodeRxPDelayRespFollowUp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a52690e55087c8f5cb908d111c7431552">XEmacPs_DecodeRxSync()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#ac715c74d5783fba5952029ee1f47495e">XEmacPs_ReadAnnounceFrame()</a>.</p>

</div>
</div>
<a id="a3674aa1b8a9b3b0bd90b5651a7cb98f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3674aa1b8a9b3b0bd90b5651a7cb98f9">&#9670;&nbsp;</a></span>XEmacPs_GetSequenceId()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 XEmacPs_GetSequenceId </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to extract SequenceId information from a received PTP frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>contains the PTP buffer from which the portIdentity is to be extracted.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The extracted sequence ID.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#a696297bb61249e62e6901699128548c6">XEmacPs_DecodeRxFollowUp()</a>, <a class="el" href="xemacps__ieee1588_8h.html#aebc1db0f6eab6b6f44033a7eb5680577">XEmacPs_DecodeRxPDelayRespFollowUp()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a52690e55087c8f5cb908d111c7431552">XEmacPs_DecodeRxSync()</a>.</p>

</div>
</div>
<a id="a0ffeb1c5ab24c4077e7c2591eaf7c03b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ffeb1c5ab24c4077e7c2591eaf7c03b">&#9670;&nbsp;</a></span>XEmacPs_HandleRecdPTPPacket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_HandleRecdPTPPacket </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is processes the received packets. </p>
<p>This is invoked from XEmacPs_RunIEEE1588Protocol. It copies the received packet from the RxBuf to the corresponding buffer in XEmacPs_Ieee1588 structure instance.It then identifies the type of PTP packet received and calls the corresponding handlers to do further processing. It then frees the corresponding BD, does a allocation of the freed BD and populates the BD with appropriate buffer address (RxBuf).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#gae8a9b2d189549fd168b4a40c6967ac31">XEmacPs_BdRingFromHwRx()</a>, <a class="el" href="group__emacps__v3__1.html#gaa0203004a3b96feae1af6239417db4c3">XEmacPs_GetRxRing</a>, and <a class="el" href="group__emacps__v3__1.html#gac64d6f46e958baa7230be816b98c2df9">XEmacPs_GetTxRing</a>.</p>

</div>
</div>
<a id="a7430d97c13ae2d1839d71ed8cd433494"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7430d97c13ae2d1839d71ed8cd433494">&#9670;&nbsp;</a></span>XEmacPs_htonll()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_htonll </td>
          <td>(</td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to do endian conversion for long long int type. </p>
<p>This is for little to big endian conversion.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Parameter</td><td>whose endian conversion is needed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The endian converted value.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588__example_8c.html#a186f468b317a1f253570a46b103197f2">XEmacPs_ntohll()</a>.</p>

</div>
</div>
<a id="acef839505ebb9e7e3ac182d06a42a25e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acef839505ebb9e7e3ac182d06a42a25e">&#9670;&nbsp;</a></span>XEmacPs_IncSequenceId()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 XEmacPs_IncSequenceId </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to increment sequence ID in a PTP frames. </p>
<p>It first extracts the sequence ID and then increments and puts it back in the PTP frame.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>contains the PTP buffer from which the portIdentity is to be extracted.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The incremented sequence ID.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ab9f6dd2305bed120624b1c3cdfff2212">XEmacPs_MasterSendAnnounce()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a493b403b2f9babe7778c9ef4f37dbe54">XEmacPs_SendPDelayReq()</a>.</p>

</div>
</div>
<a id="a8da30744d86bbb68534b012879e71b4f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8da30744d86bbb68534b012879e71b4f">&#9670;&nbsp;</a></span>XEmacPs_InitializeEmacPsDma()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_InitializeEmacPsDma </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePntr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the EmacPs DMA buffer descriptors. </p>
<p>16 BDs are used on the Tx path and 16 on the Rx path. On the Rx path a 2-dimensional array RxBuf[16][1540] is used. The last byte in each of the buffers is used to mark whether the RxBuf is already submitted or not. For example, if the location RxBuf[1][1539] is 1, then it means the RxBuf[1] is already submitted. During initialization, for 16 BDs, 16 RxBufs are submitted (RxBuf[0, RxBuf[1], ... RxBuf[15]]) and the corresponding entries RxBuf[0][1539], RxBuf[1][1539], ... RxBuf[15][1539] are marked as 1. On the Rx path, all 16 BDs are submitted to the hardware. Once that is done, the timer is started and so is the EmacPs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is a pointer to the instance of the EmacPs.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#gaf95ab3f6c363667f67cfa83facb35f8f">XEmacPs_BdClear</a>, <a class="el" href="group__emacps__v3__1.html#ga8e84294f518be6f9089cbac00e924056">XEmacPs_BdRingCreate()</a>, <a class="el" href="group__emacps__v3__1.html#gaa0203004a3b96feae1af6239417db4c3">XEmacPs_GetRxRing</a>, and <a class="el" href="group__emacps__v3__1.html#gac64d6f46e958baa7230be816b98c2df9">XEmacPs_GetTxRing</a>.</p>

</div>
</div>
<a id="a9aae1b911dbc718a33b33b97fa7ac4e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aae1b911dbc718a33b33b97fa7ac4e8">&#9670;&nbsp;</a></span>XEmacPs_InitializeProtocolData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_InitializeProtocolData </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePntr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does various initializations. </p>
<ul>
<li>It initializes the Local Port Identity. Clock Identity is initialized with 000A35FFFE010203 and port number as 1.</li>
<li>It initializes some of the fields of Tx PTP buffers. These fields remain constant over time and hence are initialized at one place.</li>
<li>It initializes signalling frame data. Since signalling frames are not implemented, the entries in the structure SignallingFrameData are hard coded.</li>
<li>The entries in the structure instance PtpCounters are initialized to 0.</li>
<li>The variable PtpIsRunning is made as 1 so that PTP packets Tx can be initiated in the Timer ISR.</li>
<li>The PTP node is made as Master to start with.</li>
<li>The Peer Ieee1588v2 capability is made as 0 which means the peer is not Ieee1588v2 capable.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8c.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster()</a>, <a class="el" href="xemacps__ieee1588_8c.html#a3eadb10f5bb3b62179164480fd3b8a19">XEmacPs_ChangePeerIeee1588v2Capability()</a>, <a class="el" href="xemacps__ieee1588_8c.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588__example_8c.html#a2606ea47dd80be535954c8aafc162aa7">XEmacPs_SetDfltTxFrms()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588__example_8c.html#a38b8729ccc6e982cf4fcd3731626b375">XEmacPs_ResetIeee1588Protocol()</a>.</p>

</div>
</div>
<a id="a60ba6528f84c63eddc3c140b300efca5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60ba6528f84c63eddc3c140b300efca5">&#9670;&nbsp;</a></span>XEmacPs_InitScuTimer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XEmacPs_InitScuTimer </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the SCUTimer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS to indicate success.<ul>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a0aee2ebfdfe52395961f9c4a5b15063e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0aee2ebfdfe52395961f9c4a5b15063e">&#9670;&nbsp;</a></span>XEmacPs_IsRxFramePTP()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_IsRxFramePTP </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function extracts length/type information from the Ethernet packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>contains the Ethernet packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a186f468b317a1f253570a46b103197f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a186f468b317a1f253570a46b103197f2">&#9670;&nbsp;</a></span>XEmacPs_ntohll()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_ntohll </td>
          <td>(</td>
          <td class="paramtype">long long int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to do endian conversion for long long int type. </p>
<p>This is for big to little endian conversion.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Parameter</td><td>whose endian conversion is needed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The endian converted value.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588__example_8c.html#a7430d97c13ae2d1839d71ed8cd433494">XEmacPs_htonll()</a>.</p>

</div>
</div>
<a id="add0c0b1f239d066840410743cdea56a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add0c0b1f239d066840410743cdea56a7">&#9670;&nbsp;</a></span>XEmacPs_PHYSetup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PHYSetup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *&#160;</td>
          <td class="paramname"><em>EmacPsInstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function configures the PHY with proper speed settings and set up the PHY to be used subsequently. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is a pointer to the instance of the EmacPs.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a3b7f7095bf60db3e9b040efd685d64c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b7f7095bf60db3e9b040efd685d64c3">&#9670;&nbsp;</a></span>XEmacPs_PtpErrorInterruptHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PtpErrorInterruptHandler </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ErrorWord</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the Error interrupt callback invoked from the EmacPs driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588. </td></tr>
    <tr><td class="paramname">Direction</td><td>can be Rx or Tx </td></tr>
    <tr><td class="paramname">ErrorWord</td><td>gives further information about the exact error type.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function needs to be revisited. Probably upon an error we need to reset the EmacPs hardware and reinitialize the BDs. However further study is needed. Whether for all errors we need to reset or some errors can be ignored. </dd></dl>

</div>
</div>
<a id="a1d750260e03c30360de133c3412b146b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d750260e03c30360de133c3412b146b">&#9670;&nbsp;</a></span>XEmacPs_PtpRxInterruptHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PtpRxInterruptHandler </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the EmacPs Rx interrupt callback invoked from the EmacPs driver. </p>
<p>Here we set the flag PtpNewPktRecd to true. This flag is checked for in the function XEmacPs_RunIEEE1588Protocol for further processing of packets.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a24b724fc0f49b35cb48284662f47ff38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24b724fc0f49b35cb48284662f47ff38">&#9670;&nbsp;</a></span>XEmacPs_PtpTxDoFurtherProcessing()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PtpTxDoFurtherProcessing </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is invoked from the TxDone callback. </p>
<p>For sync frame it obtains the time stamp and populates the FollowUp frame Tx buffer. For PDelayReq and PDelayResp frames it obtains the time stamp and stores it is appropriate buffers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>which contains the buffer just transmitted</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#a63a23dce0edb87eb919ae03f814d9615">XEmacPs_GetMsgType()</a>.</p>

</div>
</div>
<a id="af93807a4c6a17813088a71fdd6bf83f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af93807a4c6a17813088a71fdd6bf83f4">&#9670;&nbsp;</a></span>XEmacPs_PtpTxInterruptHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PtpTxInterruptHandler </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the Tx Done interrupt callback invoked from the EmacPs driver. </p>
<p>For some PTP packets, upon getting a Tx done interrupt some actions need to be taked. For example, when SYNC frame is successfully sent and Tx Done interrupt is received, the time stamp for the SYNC frame needs to be stored. For all such processing the function XEmacPs_PtpTxDoFurtherProcessing is invoked from here.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#ga7deb944fa938960a3b45f0d8adf18108">XEmacPs_BdRingFromHwTx()</a>, and <a class="el" href="group__emacps__v3__1.html#gac64d6f46e958baa7230be816b98c2df9">XEmacPs_GetTxRing</a>.</p>

</div>
</div>
<a id="a4c91eead95c645071cc2df1e36109de7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c91eead95c645071cc2df1e36109de7">&#9670;&nbsp;</a></span>XEmacPs_PtpTxPacket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XEmacPs_PtpTxPacket </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>PacketLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is initiates a PTP Tx. </p>
<p>This is called from various places.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the packet to be Txed </td></tr>
    <tr><td class="paramname">PacketLen</td><td>is the length of the packet to be Txed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#gad7e175fa90e13d73738f0ef6c34055e0">XEmacPs_BdClearTxUsed</a>, <a class="el" href="group__emacps__v3__1.html#gabadbd5215bb371a7f10f8bd1acc2db38">XEmacPs_BdRingAlloc()</a>, <a class="el" href="group__emacps__v3__1.html#gacbfaf8300ce76fa1853ee9b1a113fbd0">XEmacPs_BdRingToHw()</a>, <a class="el" href="group__emacps__v3__1.html#gab66b941886b7e22b032abfeead5421a6">XEmacPs_BdSetAddressTx</a>, <a class="el" href="group__emacps__v3__1.html#ga6d15c187fa133cb4b74489d60ad08c39">XEmacPs_BdSetLast</a>, <a class="el" href="group__emacps__v3__1.html#gada34a849a6d7387c1310a498e8a11857">XEmacPs_BdSetLength</a>, <a class="el" href="group__emacps__v3__1.html#gac64d6f46e958baa7230be816b98c2df9">XEmacPs_GetTxRing</a>, <a class="el" href="group__emacps__v3__1.html#ga81a4d6db864dea35b8ddd690f7615539">XEmacPs_ReadReg</a>, <a class="el" href="group__emacps__v3__1.html#gaea55959275d2be9d140c99364aee6795">XEmacPs_Transmit</a>, and <a class="el" href="group__emacps__v3__1.html#ga8746c9de755fea06a624cc6938992074">XEMACPS_TXSR_OFFSET</a>.</p>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ab9f6dd2305bed120624b1c3cdfff2212">XEmacPs_MasterSendAnnounce()</a>.</p>

</div>
</div>
<a id="a38b8729ccc6e982cf4fcd3731626b375"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38b8729ccc6e982cf4fcd3731626b375">&#9670;&nbsp;</a></span>XEmacPs_ResetIeee1588Protocol()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_ResetIeee1588Protocol </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used when PTP node is initialized once again. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function needs to be revisited as it is partially developed as of now.. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData()</a>.</p>

</div>
</div>
<a id="a27633bcf101d94ffbe334032282ac743"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27633bcf101d94ffbe334032282ac743">&#9670;&nbsp;</a></span>XEmacPs_RunIEEE1588Protocol()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_RunIEEE1588Protocol </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *&#160;</td>
          <td class="paramname"><em>EmacInstance</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function implements the main state machine. </p>
<p>After initializing the EmacPs DMA and initializing some protocol data structures it enters into a while(1) loop. Here it repeatedly checks if a new packet has been received or not. If received (the ISR marks the variable PtpNewPktRecd as true), then it calls XEmacPs_HandleRecdPTPPacket for further processing. Similarly if a packet needs to be sent out (as marked by the bits in variable PTPSendPacket, it sends it out.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is a pointer to the instance of the EmacPs.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#gaf27b057022a2e97201f6d55d61d4a3da">XEmacPs_Stop()</a>.</p>

</div>
</div>
<a id="a2606ea47dd80be535954c8aafc162aa7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2606ea47dd80be535954c8aafc162aa7">&#9670;&nbsp;</a></span>XEmacPs_SetDfltTxFrms()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_SetDfltTxFrms </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to populate the PTP Tx buffers. </p>
<p>Some of the entries in a PTP Tx packet do not change with time and are constants over time for this PTP standalone example. Those entries are populated here.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData()</a>.</p>

</div>
</div>
<a id="a29261bb6048535d05b0e3e4cc417f3b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29261bb6048535d05b0e3e4cc417f3b8">&#9670;&nbsp;</a></span>XEmacPs_SetupIntrSystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XEmacPs_SetupIntrSystem </td>
          <td>(</td>
          <td class="paramtype">XScuGic *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__emacps__v3__1.html#ga7510da8ed2cb292c5abdbcc18cc26c67">XEmacPs</a> *&#160;</td>
          <td class="paramname"><em>EmacPsInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XScuTimer *&#160;</td>
          <td class="paramname"><em>TimerInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>EmacPsIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>TimerIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets up interrupts. </p>
<p>It registers interrupt handlers and then enables them..</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">IntcInstancePtr</td><td>is a pointer to the instance of the SCUGic.. </td></tr>
    <tr><td class="paramname">EmacPsInstancePtr</td><td>is a pointer to the instance of the EmacPs. </td></tr>
    <tr><td class="paramname">TimerInstancePtr</td><td>is a pointer to the instance of the SCUTimer. </td></tr>
    <tr><td class="paramname">EmacPsIntrId</td><td>is the Interrupt ID for EmacPs and the value used is taken from xparameters_ps.h. </td></tr>
    <tr><td class="paramname">TimerIntrId</td><td>is the Interrupt ID for SCUTimer and the value used is taken from xparameters_ps.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS to indicate success.<ul>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a54ad1a8c2df4fd3f5388a93d7fbb770d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54ad1a8c2df4fd3f5388a93d7fbb770d">&#9670;&nbsp;</a></span>XEmacPs_TimerInterruptHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_TimerInterruptHandler </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the timer ISR that is invoked every 500 mseconds. </p>
<p>The Tx of PTP packets are initiated from here at appropriate intervals. When the PTP node is Master, the Tx of SYNC frame is triggered from here. Similarly Announce frame and PDelayReq frame Tx are triggered from here. When the PTP node is Slave, the PDelayReq frame Tx is triggered from here.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The intervals at which SYNC, ANNOUNCE and PDelayReq are triggered are hard coded to 1 sec, 5 seconds and 4 seconds respectively. When signalling frames are implemented the hardcoded values can be replaced with proper signalling frame values. </dd></dl>

</div>
</div>
<a id="adfd0ae3fd37438b0c459347d8001ee50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfd0ae3fd37438b0c459347d8001ee50">&#9670;&nbsp;</a></span>XEmacPs_TsuCalcClk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int XEmacPs_TsuCalcClk </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Freq</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate clock configuration register values for indicated input clock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">-</td><td>Freq</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS to indicate success.<ul>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
